package com.appcloner

import android.app.Application
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStore
import com.appcloner.data.local.datastore.AppPreferences
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject

val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "app_preferences")

@HiltAndroidApp
class AppClonerApplication : Application() {
    
    @Inject
    lateinit var appPreferences: AppPreferences
    
    override fun onCreate() {
        super.onCreate()
        instance = this
    }
    
    companion object {
        lateinit var instance: AppClonerApplication
            private set
    }
}
